#ifndef _REG_NCU_H_
#define _REG_NCU_H_

#include <stdint.h>


#define ISP_BASE		(0X13380000)
#define VIC_BASE		(0x13300000)
#define CPM_BASE        (0x10000000)
#define LFB_BASE        (0x13300000)
#define MSCA_BASE       (0x130b0000)


#define  BUF_SIZE                       (4096)
#define  NCU_BASE                       (0x13090000)
#define  NCU_RESET                      (0x0)
#define  NCU_START                      (0x4)
#define  NCU_STOP                       (0x8)
#define  NCU_SREG_CNTRL                 (0xc)
#define  NCU_INT_CNTRL                  (0x10)
#define  NCU_STATUS                     (0x14)
#define  NCU_DEBUG_SEL                  (0x18)
#define  NCU_DEBUG_VAL                  (0x1c)
#define  NCU_CLK_CNT                    (0x20)
#define  NCU_FUN_CNTRL                  (0x24)
#define  NCU_CUT_VALUE                  (0x28)
#define  NCU_FRAME_SIZE                 (0x2c)

#define  NCU_Y_CUR_ADDR                 (0x30)
#define  NCU_Y_CUR_STRIDE               (0x34)
#define  NCU_Y_REF_BUF0_ADDR            (0x38)
#define  NCU_Y_REF_BUF0_STRIDE          (0x3c)
#define  NCU_UV_CUR_ADDR                (0x40)
#define  NCU_UV_CUR_STRIDE              (0x44)
#define  NCU_UV_REF_BUF0_ADDR           (0x48)
#define  NCU_UV_REF_BUF0_STRIDE         (0x4c)
#define  NCU_Y_REF_BUF1_ADDR            (0x50)
#define  NCU_Y_REF_BUF1_STRIDE          (0x54)
#define  NCU_UV_REF_BUF1_ADDR           (0x58)
#define  NCU_UV_REF_BUF1_STRIDE         (0x5c)
#define  NCU_YUV_PSN_FRM_MAX_NUM        (0x60)
#define  NCU_Y_PSN_ADDR                 (0x64)
#define  NCU_Y_PSN_STRIDE               (0x68)
#define  NCU_Y_PSN_FRM_STRIDE           (0x6c)
#define  NCU_U_PSN_ADDR                 (0x70)
#define  NCU_U_PSN_STRIDE               (0x74)
#define  NCU_U_PSN_FRM_STRIDE           (0x78)
#define  NCU_V_PSN_ADDR                 (0x7c)
#define  NCU_V_PSN_STRIDE               (0x80)
#define  NCU_V_PSN_FRM_STRIDE           (0x84)

#define  NCU_YUV_STA_FRM_MAX_NUM        (0x88)
#define  NCU_Y_STA_ADDR                 (0x8c)
#define  NCU_Y_STA_STRIDE               (0x90)
#define  NCU_Y_STA_FRM_STRIDE           (0x94)
#define  NCU_U_STA_ADDR                 (0x98)
#define  NCU_U_STA_STRIDE               (0x9c)
#define  NCU_U_STA_FRM_STRIDE           (0xa0)
#define  NCU_V_STA_ADDR                 (0xa4)
#define  NCU_V_STA_STRIDE               (0xa8)
#define  NCU_V_STA_FRM_STRIDE           (0xac)
#define  NCU_Y_OUT_RETIME_PAR           (0xb0)
#define  NCU_UV_OUT_RETIME_PAR          (0xb4)
#define  NCU_HBLANK_ADJ                 (0xb8)

#define  NCU_Y_STA_BLK0_POS             (0xc0)
#define  NCU_Y_STA_BLK1_POS             (0xc4)
#define  NCU_Y_STA_BLK2_POS             (0xc8)
#define  NCU_Y_STA_BLK3_POS             (0xcc)
#define  NCU_Y_STA_BLK0_VAL             (0xd0)
#define  NCU_Y_STA_BLK1_VAL             (0xd4)
#define  NCU_Y_STA_BLK2_VAL             (0xd8)
#define  NCU_Y_STA_BLK3_VAL             (0xdc)
#define  NCU_Y_STA_FRM_VAL              (0xe0)
#define  NCU_UV_STA_BLK0_POS            (0xe4)
#define  NCU_UV_STA_BLK1_POS            (0xe8)
#define  NCU_UV_STA_BLK2_POS            (0xec)
#define  NCU_UV_STA_BLK3_POS            (0xf0)
#define  NCU_U_STA_BLK0_VAL             (0xf4)
#define  NCU_U_STA_BLK1_VAL             (0xf8)
#define  NCU_U_STA_BLK2_VAL             (0xfc)
#define  NCU_U_STA_BLK3_VAL             (0x100)
#define  NCU_U_STA_FRM_VAL              (0x104)
#define  NCU_V_STA_BLK0_VAL             (0x108)
#define  NCU_V_STA_BLK1_VAL             (0x10c)
#define  NCU_V_STA_BLK2_VAL             (0x110)
#define  NCU_V_STA_BLK3_VAL             (0x114)
#define  NCU_V_STA_FRM_VAL              (0x118)

#define  NCU_Y_FS_AVE_PAR               (0x180)
#define  NCU_Y_FS_SIGMA_CORR_AD_X_PAR   (0x184)
#define  NCU_Y_FS_SIGMA_CORR_AD_Y_PAR   (0x188)
#define  NCU_Y_FS_SIGMA_CORR_AD_S_PAR   (0x18c)
#define  NCU_Y_FS_SIGMA_PFR_AD_X_PAR    (0x190)
#define  NCU_Y_FS_SIGMA_PFR_AD_Y_PAR    (0x194)
#define  NCU_Y_FS_SIGMA_PFR_AD_S_PAR    (0x198)
#define  NCU_Y_FS_PFR_DIFF_PAR0         (0x19C)
#define  NCU_Y_FS_PFR_DIFF_PAR1         (0x1A0)
#define  NCU_Y_FS_FLUCT_HG_DIFF_PAR     (0x1A4)
#define  NCU_Y_FS_FLUCT_BR_DIFF_PAR     (0x1A8)
#define  NCU_Y_FS_FLUCT_DK_DIFF_PAR     (0x1AC)     //###
#define  NCU_Y_FS_PXL_DIFF_THRES        (0x1B0)

#define  NCU_Y_SE_AVE_PAR               (0x1D0)
#define  NCU_Y_SE_SIGMA_BDV_X_PAR0      (0x1D4)
#define  NCU_Y_SE_SIGMA_BDV_X_PAR1      (0x1D8)
#define  NCU_Y_SE_SIGMA_BDV_Y_PAR0      (0x1DC)
#define  NCU_Y_SE_SIGMA_BDV_Y_PAR1      (0x1E0)
#define  NCU_Y_SE_SIGMA_BDV_S_PAR0      (0x1E4)
#define  NCU_Y_SE_SIGMA_BDV_S_PAR1      (0x1E8)
#define  NCU_Y_SE_BDV_ADJ_PAR0          (0x1EC)
#define  NCU_Y_SE_BDV_ADJ_PAR1          (0x1F0)
#define  NCU_Y_SE_BDV_ADJ_PAR2          (0x1F4)
#define  NCU_Y_SE_BDV_ADJ_PAR3          (0x1F8)
#define  NCU_Y_SE_DIFF_THRES            (0x1FC)
#define  NCU_Y_SE_STATIS_PAR            (0x200)
#define  NCU_Y_SE_REF_WEI               (0x204)
#define  NCU_Y_SE_CORNER_PAR            (0x208)

#define  NCU_Y_FUSION_AVE_PAR           (0x220)
#define  NCU_Y_S_FUSION_SGM_EDGE_X_PAR0 (0x224)
#define  NCU_Y_S_FUSION_SGM_EDGE_X_PAR1 (0x228)
#define  NCU_Y_S_FUSION_SGM_EDGE_Y_PAR0 (0x22C)
#define  NCU_Y_S_FUSION_SGM_EDGE_Y_PAR1 (0x230)
#define  NCU_Y_S_FUSION_SGM_EDGE_S_PAR0 (0x234)
#define  NCU_Y_S_FUSION_SGM_EDGE_S_PAR1 (0x238)
#define  NCU_Y_S_FUSION_SGM_PFR_X_PAR0  (0x23C)
#define  NCU_Y_S_FUSION_SGM_PFR_X_PAR1  (0x240)
#define  NCU_Y_S_FUSION_SGM_PFR_Y_PAR0  (0x244)
#define  NCU_Y_S_FUSION_SGM_PFR_Y_PAR1  (0x248)
#define  NCU_Y_S_FUSION_SGM_PFR_S_PAR0  (0x24C)
#define  NCU_Y_S_FUSION_SGM_PFR_S_PAR1  (0x250)
#define  NCU_Y_S_FUSION_ORG_SUP_THRES   (0x254)
#define  NCU_Y_M_FUSION_SGM_EDGE_X_PAR0 (0x258)
#define  NCU_Y_M_FUSION_SGM_EDGE_X_PAR1 (0x25C)
#define  NCU_Y_M_FUSION_SGM_EDGE_Y_PAR0 (0x260)
#define  NCU_Y_M_FUSION_SGM_EDGE_Y_PAR1 (0x264)
#define  NCU_Y_M_FUSION_SGM_EDGE_S_PAR0 (0x268)
#define  NCU_Y_M_FUSION_SGM_EDGE_S_PAR1 (0x26C)
#define  NCU_Y_M_FUSION_SGM_PFR_X_PAR0  (0x270)
#define  NCU_Y_M_FUSION_SGM_PFR_X_PAR1  (0x274)
#define  NCU_Y_M_FUSION_SGM_PFR_Y_PAR0  (0x278)
#define  NCU_Y_M_FUSION_SGM_PFR_Y_PAR1  (0x27C)
#define  NCU_Y_M_FUSION_SGM_PFR_S_PAR0  (0x280)
#define  NCU_Y_M_FUSION_SGM_PFR_S_PAR1  (0x284)
#define  NCU_Y_M_FUSION_ORG_SUP_THRES   (0x288)

#define  NCU_Y_PSN_PAR_0                (0x2a0)
#define  NCU_Y_PSN_PAR_1                (0x2a4)
#define  NCU_Y_STA_AVE_PAR              (0x2a8)
#define  NCU_Y_STA_SIZE_PAR             (0x2ac)
#define  NCU_Y_STA_MV_BLK_ADJ           (0x2b0)
#define  NCU_Y_STA_DIFF_THRES           (0x2b4)
#define  NCU_Y_STA_MV_NUM_THRES         (0x2b8)
#define  NCU_Y_LUM_AREA_PAR             (0x2bc)
#define  NCU_Y_STA_SIZE_INCR_PAR        (0x2c0)
#define  NCU_Y_STA_SIZE_NUM_PAR         (0x2c4)

#define  NCU_Y_ST2_SGM_P_X_PAR          (0x2d0)
#define  NCU_Y_ST2_SGM_P_Y_PAR          (0x2d4)
#define  NCU_Y_ST2_SGM_P_S_PAR          (0x2d8)
#define  NCU_Y_ST2_GAUS_SGM_PAR         (0x2dc)

#define  NCU_UV_FS_AVE_PAR              (0x300)
#define  NCU_UV_FS_CORR_SIGMA_X         (0x304)
#define  NCU_UV_FS_CORR_SIGMA_Y         (0x308)
#define  NCU_UV_FS_CORR_SIGMA_S         (0x30c)
#define  NCU_UV_FS_PFR_SIGMA_X          (0x310)
#define  NCU_UV_FS_PFR_SIGMA_Y          (0x314)
#define  NCU_UV_FS_PFR_SIGMA_S          (0x318)
#define  NCU_UV_FS_PFR_DIFF_PAR_0       (0x31C)
#define  NCU_UV_FS_PFR_DIFF_PAR_1       (0x320)
#define  NCU_UV_FS_HG_FLUCT_PAR         (0x324)
#define  NCU_UV_FS_UHG_BR_FLUCT_PAR     (0x328)
#define  NCU_UV_FS_UHG_DK_FLUCT_PAR     (0x32C)

#define  NCU_UV_SE_CON_PAR              (0x340)
#define  NCU_UV_SE_PIX_LINE_THRES       (0x344)
#define  NCU_UV_SE_BDV_SIGMA_X_0        (0x348)
#define  NCU_UV_SE_BDV_SIGMA_X_1        (0x34c)
#define  NCU_UV_SE_BDV_SIGMA_Y_0        (0x350)
#define  NCU_UV_SE_BDV_SIGMA_Y_1        (0x354)
#define  NCU_UV_SE_BDV_SIGMA_S_0        (0x358)
#define  NCU_UV_SE_BDV_SIGMA_S_1        (0x35c)
#define  NCU_UV_SE_BDV_ADJ_0            (0x360)
#define  NCU_UV_SE_BDV_ADJ_1            (0x364)
#define  NCU_UV_SE_BDV_ADJ_2            (0x368)
#define  NCU_UV_SE_BDV_ADJ_3            (0x36c)
#define  NCU_UV_SE_CORNER_PAR           (0x370)

#define  NCU_UV_FUSION_MV_JUDGE_THRES   (0x390)
#define  NCU_UV_FUSION_S_EDGE_SIGMA_X   (0x394)
#define  NCU_UV_FUSION_S_EDGE_SIGMA_Y   (0x398)
#define  NCU_UV_FUSION_S_EDGE_SIGMA_S   (0x39c)
#define  NCU_UV_FUSION_S_PFR_SIGMA_X    (0x3a0)
#define  NCU_UV_FUSION_S_PFR_SIGMA_Y    (0x3a4)
#define  NCU_UV_FUSION_S_PFR_SIGMA_S    (0x3a8)
#define  NCU_UV_FUSION_S_BLUR_PAR       (0x3ac)
#define  NCU_UV_FUSION_S_LUM_PAR        (0x3b0)
#define  NCU_UV_FUSION_M_EDGE_SIGMA_X   (0x3b4)
#define  NCU_UV_FUSION_M_EDGE_SIGMA_Y   (0x3b8)
#define  NCU_UV_FUSION_M_EDGE_SIGMA_S   (0x3bc)
#define  NCU_UV_FUSION_M_PFR_SIGMA_X    (0x3c0)
#define  NCU_UV_FUSION_M_PFR_SIGMA_Y    (0x3c4)
#define  NCU_UV_FUSION_M_PFR_SIGMA_S    (0x3c8)
#define  NCU_UV_FUSION_M_BLUR_PAR       (0x3cc)
#define  NCU_UV_FUSION_M_LUM_PAR        (0x3d0)

#define  NCU_UV_PSN_PAR_0               (0x3e0)
#define  NCU_UV_PSN_PAR_1               (0x3e4)
#define  NCU_UV_STA_BLK_SIZE            (0x3e8)
#define  NCU_UV_STA_BLK_ADJ             (0x3ec)
#define  NCU_UV_STA_DIFF_THRES          (0x3f0)
#define  NCU_UV_STA_NUM_THRES           (0x3f4)
#define  NCU_UV_FALSE_COLOR_PAR         (0x3f8)
#define  NCU_UV_STA_BLK_SIZE_INCR       (0x3fc)
#define  NCU_UV_STA_BLK_SIZE_NUM        (0x400)

#define  NCU_NCU_PP_RESET               (0x500)
#define  NCU_NCU_PP_STOP                (0x504)
#define  NCU_NCU_PP_FST_FRM             (0x508)
#define  NCU_NCU_PP_SREG_CNTRL          (0x50c)
#define  NCU_NCU_PP_INT_CNTRL           (0x510)
#define  NCU_NCU_PP_STATUS              (0x514)
#define  NCU_NCU_PP_DBG_SEL             (0x518)
#define  NCU_NCU_PP_DBG_VLD             (0x51c)
#define  NCU_NCU_PP_CLK_CNT             (0x520)
#define  NCU_NCU_PP_FRM_SIZE            (0x524)
#define  NCU_NCU_PP_Y_BUF0_ADDR         (0x528)
#define  NCU_NCU_PP_Y_BUF0_STRIDE       (0x52c)
#define  NCU_NCU_PP_Y_BUF1_ADDR         (0x530)
#define  NCU_NCU_PP_Y_BUF1_STRIDE       (0x534)
#define  NCU_NCU_PP_UV_BUF0_ADDR        (0x538)
#define  NCU_NCU_PP_UV_BUF0_STRIDE      (0x53c)
#define  NCU_NCU_PP_UV_BUF1_ADDR        (0x540)
#define  NCU_NCU_PP_UV_BUF1_STRIDE      (0x544)
#define  NCU_NCU_PP_STA_BUF0_ADDR       (0x548)
#define  NCU_NCU_PP_STA_BUF0_STRIDE     (0x54c)
#define  NCU_NCU_PP_STA_BUF1_ADDR       (0x550)
#define  NCU_NCU_PP_STA_BUF1_STRIDE     (0x554)
#define  NCU_NCU_PP_FUN_CNTRL           (0x558)
#define  NCU_NCU_PP_STA_BLK_SIZE        (0x55c)
#define  NCU_NCU_PP_STA_DIFF_THRES0     (0x560)
#define  NCU_NCU_PP_STA_DIFF_THRES1     (0x564)
#define  NCU_NCU_PP_STA_DIFF_THRES2     (0x568)
#define  NCU_NCU_PP_STA_DIFF_THRES3     (0x56c)
#define  NCU_NCU_PP_STA_DIFF_THRES_FNL  (0x570)
#define  NCU_NCU_PP_STA_DIFF_MASK       (0x574)
#define  NCU_NCU_PP_STA_MAX_NUM         (0x578)
#define  NCU_NCU_PP_ADDR_CNTRL          (0x57c)

#define PRINTREG(x) printf("---%-28s(0x%-3x) = 0x%08x\n", #x,x, ncu_reg_read(x))

#endif
